<?php
include_once('admin-load.php');
	$tracking_id = isset($_REQUEST['tracking_id'])?$_REQUEST['tracking_id']:null;
        $tracking='';
     if ($tracking_id) {
            
            $tracking = $dbna->get_row("SELECT * FROM tracking WHERE id = $tracking_id ");
            
     }

   if (isset($_POST['submit_form'])) {
        update_tracking();
    }
?> 
<?php
	include_once 'header.php';
?>
            <div id="main_content">
                <div id="content">
                    
				</div>
					<div class="container">
            <h5>Update tracking</h5>

					</div>
				<div id="main">
                    <h2>Create New Tracking</h2>
                    <form id="add_user" action="tracking-edit.php" method="post">
                        <input type="hidden" value="1" name="submit_form"/>
                        <input type="hidden" value="<?php echo $tracking_id ?>"name="user_id" />
                        <fieldset>
                            <legend>.: Form edit new tracking  </legend>
                        <div>
                    <label for="bill_id">Tracking Number : </label>
                    <input type="text" id=bill_id" name="bill_id"/>
                </div>
                <div>
                    <label for="shipped_on">Shipped on : </label>
                    <input type="text" id="shipped_on" name="shipped_on"/>
                </div>
                <div>
                    <label for="destination">Destination : </label>
                    <input type="text" id="destination" name="destination"/>
                </div>
                <div>
                    <label for="delivered_date">Delivered Date : </label>
                    <input type="text" id="delivered_date" name="delivered_date" />
                </div>
            </fieldset>
            <fieldset>
                <legend>.: Detail</legend>
                <div>
                    <label for="description"> Description : </label>
                    <input type="text" id="description" name="description"/>
                </div>
                <div>
                    <label for="detail_date">Date : </label>
                    <input type="text" id="detail_date" name="detail_date" />
                </div>
                <div>
                    <label for="status_id">Status : </label>
                    <select id="status_id" name="status_id">
                        <?php echo selectStatus()  ?>
                    </select>
                </div>
                <div>
                    <label for="location_id">Location : </label>
                    <select id="location_id" name="location_id">
                        <?php  echo selectLocation() ?>
                    </select>
                </div>
                <div>
                    <label for="sign_by">Sign by : </label>
                    <input type="text" id="sign_by" name="sign_by" />
                </div>
                 <div>
                    <label for="weight">Weight : </label>
                    <input type="text" id="weight" name="weight" />
                </div>
                 <div>
                    <label for="piece">Piece : </label>
                    <input type="text" id="piece" name="piece" />
                </div>

            </fieldset>

                <div class="buttons">
                    <input type="submit" value="Update" name="submit"/>   
                </div>
        </form>
                </div>
            </div>
            <script>
	$(function() {
		$( ".datepicker" ).datepicker({dateFormat:"yy-mm-dd"});
	});
	</script>
<?php 
	include_once 'footer.php';
?>